<?php
    //--- Giu gia tri cua form
    $name = array(
                        "name"  => "name",
                        "id"    => "name",
                        "size"  => "30",
                        "value" => $info["ten"],
                    );
    
    $submit = array(
                'name'        => 'ok',
                'value'          => 'UPDATE',
            );
    ?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<?php echo base_url('public_source/css_source/register.css')?>" rel="stylesheet" type="text/css">
        <script src="<?php echo base_url('public_source/javascript/jquery-1.9.1.js')?>" type="text/javascript"></script> 
        <script>
            $(document).ready(function(){
                $("#count").change(function(){
                    var count = $("#count").val();
                    var gia = <?php echo $info["gia1"];?>;
                    var giamoi = parseInt(count) * parseInt(gia); 
                    $("#cost1").val(giamoi);
                    $("#cost").html(giamoi+" VNĐ");
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <div ID="box_entry">
            <div id="Detail_Register">
                <form action="" method="post" enctype="multipart-formdata">
                    <table cellspacing="15px">
                        <tr>
                            <td>Tên sản phẩm</td>
                            <td><?php echo form_input($name);?></td>
                        </tr>
                        <tr>
                            <td>Số lượng</td>
                            <td><input id="count" name="count" type="number" min="1" max="100" value="<?php echo $info["soluong"] ?>"></td>
                        </tr>
                        <tr>
                            <td style="padding-top: 10px">Giá tiền</td>
                            <td style="color: red; padding-top: 10px"><strong id="cost"><?php echo $giacu;?> VNĐ</strong></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><?php echo form_submit($submit)?></td>
                        </tr>
                        <input id="cost1" name="cost" type="hidden">
                    </table>
                </form>
            </div>
        </div>
    </body>
</html>